package main

import "fmt"

func main() {
	var userinfo = make([]map[string]string, 3, 3)

	//fmt.Println(userinfo[0]) //map[]

	//fmt.Println(userinfo[0] == nil) //true	map不初始化的默认值nil
	if userinfo[0] == nil {
		userinfo[0] = make(map[string]string)
		userinfo[0]["username"] = "张三"
		userinfo[0]["age"] = "20"
		userinfo[0]["height"] = "180cm"
	}

	if userinfo[1] == nil {
		userinfo[1] = map[string]string{
			"username": "李四",
			"age":      "18",
			"height":   "165cm",
		}
	}

	if userinfo[2] == nil {
		userinfo[2] = map[string]string{
			"username": "王五",
			"age":      "17",
			"height":   "170cm",
		}
	}

	for _, v := range userinfo {
		for k, v2 := range v {
			fmt.Println(k, v2)
		}
		fmt.Println("----------")
	}
}
